#include<stdio.h>
#include<string.h>


void WordSort(char *word)
{
	int i,j;
    char temp;
    
	for(i=0;i<strlen(word)-1;i++)
	  for(j=0;j<strlen(word)-i-1;j++)
	   {
	   	 if(word[j]>word[j+1])
	   	 {
	   	 	temp = word[j];
	   	 	word[j]=word[j+1];
	   	 	word[j+1]=temp;
	   	 }
	   }
	puts(word);
}

int main(void)
{
	char word1[80];
	char word2[80]; 
	int i=0,j=0,k=0;
    char temp;
    char a[80],b[80];
    
	scanf("%s",word1);
	scanf("%s",word2);
	
	WordSort(word1);//       nuclear 
	WordSort(word2);//       ucelarn
	
	for(i=0;i<strlen(word1);i++)
	{
		if(word1[i]==word2[i] && i==strlen(word1)-1)
	  		  printf("Y");
	  	if(word1[i]!=word2[i] && i==strlen(word1)-1)
	 		  printf("N");			 
	}
	  	
	return 0; 
} 
